# Contributor: Thomas Böhler <witcher@wiredspace.de>
# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
pkgname=rss-email
pkgdesc="Send RSS/Atom posts as email"
pkgver=0.4.5
pkgrel=0
url="https://git.sr.ht/~witcher/rss-email"
# ppc64le, s390x, riscv64: rust-ring
arch="all !ppc64le !s390x !riscv64"
license="WTFPL"
makedepends="
	cargo
	cargo-auditable
	scdoc
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~witcher/rss-email/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # no tests


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
	scdoc < docs/rss-email.1.scd > rss-email.1
	scdoc < docs/rss-email.5.scd > rss-email.5
}

package() {
	install -Dm755 target/release/rss-email "$pkgdir"/usr/bin/rss-email
	install -Dm644 rss-email.1 "$pkgdir"/usr/share/man/man1/rss-email.1
	install -Dm644 rss-email.5 "$pkgdir"/usr/share/man/man5/rss-email.5
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
	install -Dm644 README.md "$pkgdir"/usr/share/doc/"$pkgname"/README.md
	install -Dm644 config.example.toml "$pkgdir"/usr/share/"$pkgname"/config.toml
}


sha512sums="
e12715288789240a81ac48d6e81dca63ebb4ca08ff82ea16e49a785e1c673c08e3da18635df94fc4f2165e68a0323454d627a172ed4ae1a1ef1735186a3f9e17  rss-email-0.4.5.tar.gz
"
